EWS service calls not responding.  No timeout, no error, no response

Hi.

I'm using the EWS Managed API v2.2 to make EWS calls to Exchange 2010 SP1 on premises.  The referenced code is a C# client application running in .Net 3.5 on a Windows 2008 server.

Recently at one of my customers, we have a weird situation where service calls, any service call,never receives a response.  

We are setting an explicit timeout, surrounding service calls with logging and are using EWS trace listening.  The listener show the EWSRequest SOAP message, and that's it.  The logging shows the "before service call" log entry but not the "after service call" entry.

I suspected throttling might be behind it and have temporarily removed the EWS throttling limits to no effect and in any case, I would expect an error response if throttling was kicking in.

This is how the service is initialised:

 public ExchangeWebService(string username, string password, string emailAddress, string exchangeUrl, string exchangeVersion)
    {
        ExchangeVersion exVersion = (ExchangeVersion)Enum.Parse(typeof(ExchangeVersion), exchangeVersion);
        _exchangeService = CreateExchangeService(username, password, emailAddress, exchangeUrl, exVersion);
	_exchangeService.Timeout = 30000;			
    }

    private static ExchangeService CreateExchangeService(string username, string password, string emailAddress, 
															 string exchangeUrl, ExchangeVersion exchangeVersion)
    {

	IntegrationLogging _il = new IntegrationLogging(Constants.LoggingSourceName);

	ExchangeService service = new ExchangeService(exchangeVersion);
			QualifiedUserName qualifiedName = new QualifiedUserName(username);
	NetworkCredential credentials = new NetworkCredential(qualifiedName.UserName, password);

	if (qualifiedName.HasDomain)
	{
		credentials.Domain = qualifiedName.Domain;
	}

	service.Credentials = credentials;

	if (string.IsNullOrEmpty(exchangeUrl))
	{
		if (string.IsNullOrEmpty(emailAddress))
		{
			throw new ArgumentException("emailAddress and exchangeUrl parameters cannot both be empty");
		}
		else
		{
			_il.WriteTrace(string.Format("CreateExchangeService using auto discovery with email address {0} and user name {1}. {2}", emailAddress, username, Environment.StackTrace));
			service.AutodiscoverUrl(emailAddress);
		}
	}
	else
	{
		_il.WriteTrace(string.Format("CreateExchangeService using EWS URI {0} and user name {1}", exchangeUrl, username));
		service.Url = new Uri(exchangeUrl);
	}

	return service;
    }
     




From one of the methods that never returns, we get the first log entry but not the second and our perf monitor shows the thread still running at the line of the service call.

  _il.WriteTrace("ConvertInternalIdToEwsId:mailboxAddress=" + mailboxAddress);

    AlternateIdBase _altBase = _exchangeService.ConvertId(_alternateId, IdFormat.EwsId);

    _il.WriteTrace("ConvertInternalIdToEwsId:Returned from call");

    return ((AlternateId)_altBase).UniqueId;




The service instance is of type `Microsoft.Exchange.WebServices.Data.ExchangeService`.

This problem seems to be intermittent.  How can a call not result in a response, an exception or a timeout?

                                                                                                                                                      &n
April 2nd, 2015 6:53am

Did you check the IIS logs on the target server, to make sure that the EWS requests are actually reaching it?
Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2015 9:35am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics